html {
    background-color: #f0f0f0;
    color: black;
}

body {
    margin: 0;
    margin-left: 5px;
    margin-right: 5px;
}

main,
header {
    font-family: sans-serif;
}

body>main {
    background-color: #fff;
    border: solid 1px rgb(191, 191, 191);
}

body>main,
body>header {
    font-size: 12px;
    font-family: sans-serif;
    margin: 0;
    margin-left: auto;
    margin-right: auto;
    max-width: 1024px;
}

body>header {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

button {
    background-color: #fbfbfb;
    border-color: rgb(191, 191, 191);
    border-style: solid;
    border-radius: 2px;
    border-width: 1px;
    color: black;
    cursor: pointer;
}

button:not(:disabled):hover {
    background-color: #ededed;
}

button:disabled {
    opacity: .25;
    cursor: default;
}

body>header button {
    margin-top: 5px;
    margin-bottom: 5px;
    align-self: flex-end;
    padding: 5px;
    padding-left: 10px;
    padding-right: 10px;
    margin-left: 8px;
}

.result-row {
    display: flex;
    flex-direction: row;
    padding-top: 5px;
    padding-bottom: 5px;
    min-height: 40px;
}

.result-row:not(:first-child) {
    border-top: #bfbfbf 1px dashed;
}

.result-head {
    background-color: #ececec;
}

.result-row>span {
    padding: 10px;
    align-self: center;
}

.result-row>span>span {
    padding: 5px;
}

.result-head .unselected {
    opacity: .5;
}

.result-row.result-head .result-head-separator {
    padding-left: 2px;
    padding-right: 2px;
}

.result-url-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    white-space: nowrap;
    user-select: none;
    cursor: pointer;
}

.result-row:not(.result-head) .result-url-title {
    cursor: pointer;
}

.result-status {
    min-width: 120px;
}

.result-cancel {
    text-align: right;
    width: 19px;
}

.result-cancel button {
    background-color: #fbfbfb;
    width: 19px;
    padding: 0;
}

.no-result {
    color: #888;
}

html.side-panel body {
    margin: 0;
}

html.side-panel,
.side-panel .result-head,
.side-panel body>main {
    background-color: #fbfbfb;
}

.side-panel .header-buttons {
    position: absolute;
    right: 12px;
    display: flex;
}

html.side-panel #addUrlsButton {
    display: none;
}

.side-panel body>main {
    border: 0;
    margin-left: 8px;
    margin-right: 12px;
}

.side-panel .result-status {
    display: none;
}

.side-panel .result-row>span,
.side-panel .result-row>span>span {
    padding: 0px;
}

.side-panel .result-head {
    border-bottom: dashed 1px rgb(191, 191, 191);
}

@media (max-width:400px) {

    body>main,
    body>header,
    .header-buttons>button {
        font-size: 11px;
    }

    .result-row {
        padding-top: 3px;
        padding-bottom: 3px;
        min-height: 30px;
    }

    .side-panel .header-buttons {
        top: 0px;
    }
}

@media (max-width:300px) {
    .side-panel :not(.result-cancel)>button {
        display: flex;
    }

    .side-panel .header-buttons {
        flex-direction: column;
    }

    .result-head {
        padding-bottom: 40px;
    }
}

@media (prefers-color-scheme: dark) {
    html {
        background-color: #373737;
        color: #fdfdfd;
    }

    body>main {
        border-color: rgb(81, 81, 81);
    }

    body>main,
    button {
        background-color: #202023;
        color: #fdfdfd;
    }

    .result-row {
        color: #dedede;
    }

    .result-head {
        background-color: #191919;
        color: #fdfdfd;
    }

    .no-result {
        color: #888;
    }

    .result-cancel button {
        color: #202023;
    }

    .result-cancel button:hover {
        background-color: #ccc;
    }

    button:not(:disabled):hover {
        color: #2A2A2E;
    }

    textarea {
        background-color: #fff;
    }

    button:focus {
        color: gray;
        border-color: gray;
        background-color: #d2d2d2;
    }

    html.side-panel,
    .side-panel .result-head,
    .side-panel body>main,
    .side-panel button {
        background-color: #38383d;
    }

    .side-panel .result-cancel button {
        color: #fdfdfd;
    }
}